﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/AdminMaster.master" AutoEventWireup="true" CodeFile="CandidateBriefMapping.aspx.cs" Inherits="Admin_CandidateBriefMapping" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script type="text/javascript" lang="javascript">
        function Validate(sender, args) {            
            var gridView = document.getElementById("<%=gvCandidateBriefMapping.ClientID %>");
            var checkBoxes = gridView.getElementsByTagName("input");
            for (var i = 0; i < checkBoxes.length; i++) {
                if (checkBoxes[i].type == "checkbox" && checkBoxes[i].checked) {
                    args.IsValid = true;
                    return;
                }
            }
            alert('Please select at least one candidate.');
            args.IsValid = false;
        }
    </script>
    <table style="width: 100%" id="TABLE2" cellspacing="1" cellpadding="1" border="0">
        <tbody>
            <tr>
                <td colspan="3" style="text-align: left;">
                       <h2>Candidate Brief Assignment</h2>
                </td>
            </tr>
           
            <tr>
                <td align="right" class="auto-style7"></td>
                <td align="right" colspan="2" style="height: 30px; text-align: left">

                    
                </td>
            </tr>
            <%--<tr>
                <td align="right"  width="5%"></td>
                <%--<td align="right"  width="30%">Brief Title&nbsp;&nbsp;:&nbsp;&nbsp;</td>- -%>
                <td align="right"  width="30%">Country&nbsp;&nbsp;:&nbsp;&nbsp;</td>
                <td width="65%">
                    <%--<asp:DropDownList ID="ddlBriefTitle" runat="server" OnSelectedIndexChanged="ddlBriefTitle_SelectedIndexChanged" AutoPostBack="True" CausesValidation="True">
                    </asp:DropDownList>- -%>
                    <asp:DropDownList ID="ddlCountryName" runat="server"  >
                    </asp:DropDownList>
                &nbsp;<%--<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlBriefTitle" ErrorMessage="Select Brief Title"  ForeColor="Red" InitialValue="0" Display="Dynamic"></asp:RequiredFieldValidator>- -%>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCountryName" ErrorMessage="Select Country"  ForeColor="Red" InitialValue="0" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>--%>
            <tr>
                <td align="right" colspan="3" style="height: 10px; text-align: center">&nbsp;
                    <asp:Label ID="lblMessage" style="text-align:left;" runat="server" Font-Bold="True"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <div class="grd_table" style="overflow-x: auto; width: 950px">
                        <asp:GridView ID="gvCandidateBriefMapping" runat="server" AllowPaging="True" Width="100%" AutoGenerateColumns="False" OnPageIndexChanging="gvCandidateBriefMapping_PageIndexChanging" OnSelectedIndexChanged="gvCandidateBriefMapping_SelectedIndexChanged" OnRowDataBound="gvCandidateBriefMapping_RowDataBound" >
                            <Columns>
                                <asp:TemplateField ItemStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <asp:CheckBox type="checkbox" runat="server" ID="chkIsActive" EnableViewState="true"/>

                                    </ItemTemplate>
                                    <ItemStyle Width="2%" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="CandidateID" HeaderText="Candidate ID" Visible="true">
                                    <ItemStyle Width="5%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="RegistrationNo" HeaderText="Registration No">
                                    <ItemStyle Width="5%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="FirstName" HeaderText="Candidate Name">
                                    <ItemStyle Width="5%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Email" HeaderText="Email ID">
                                    <ItemStyle Width="5%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="PartnerID" HeaderText="Partner Registration ID." Visible="true"   >
                                    <ItemStyle Width="5%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="PartnerRegistrationNo" HeaderText="Partner Registration No." Visible="true"  >
                                    <ItemStyle Width="5%" HorizontalAlign="Left" />
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:BoundField>

                                <asp:BoundField DataField="CountryId" HeaderText="CountryId" Visible="False" />
                                <asp:BoundField DataField="BriefId" HeaderText="BriefId" Visible="False" />
                                <asp:BoundField DataField="BriefTitle" HeaderText="Brief Title" />

                            </Columns>
                             <FooterStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#E2DED6" ForeColor="blue" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#CCCCCC" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                               <emptydatarowstyle forecolor="Red" HorizontalAlign="Center" BorderStyle="None" BorderWidth="0" />
                      <emptydatatemplate>
                            No candidate available for assigning brief.
                    </emptydatatemplate> 
                        </asp:GridView>
                        <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage=""
                        ClientValidationFunction="Validate" ForeColor="Red"></asp:CustomValidator>
                    </div>
                </td>
            </tr>

            <tr>
                <td align="right" colspan="3" style="height: 30px; text-align: center">

                    <asp:Button ID="btnSave" runat="server" SkinID="buttonSkin" Text="Apply" OnClick="btnSave_Click" />
                    &nbsp; &nbsp;
                                 <asp:Button ID="btnCancel" runat="server" SkinID="buttonSkin" Text="Cancel" CausesValidation="false" OnClick="btnCancel_Click" />
                    &nbsp; &nbsp;
                              
                </td>
            </tr>
            <tr>
                <td align="right" colspan="3" style="height: 30px; text-align: center"></td>
            </tr>
            <tr>
                <td align="right" colspan="3" style="height: 30px; text-align: left"><h3>County has more then one or no Active brief.</h3></td>
            </tr>
            <tr>
                <td align="right" colspan="3" style="height: 30px; text-align: center">
                    <div class="grd_table" style="overflow-x: auto; width: 950px">
                    <asp:GridView ID="gvBriefIssue" runat="server" AutoGenerateColumns="False">
                        <Columns>
                            <asp:BoundField DataField="RegistrationNo" HeaderText="Registration No">
                                <ItemStyle Width="5%" HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="FirstName" HeaderText="Candidate Name">
                                <ItemStyle Width="5%" HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Email" HeaderText="Email ID">
                                <ItemStyle Width="5%" HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CountryName" HeaderText="Country Name">
                                <ItemStyle Width="5%" HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="TotalActiveBrief" HeaderText="Total Active Brief in Country">
                                <ItemStyle Width="5%" HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                        </Columns>
                    </asp:GridView>
                        </div>
                </td>
            </tr>
            <tr>
                <td align="right" colspan="3" style="height: 30px; text-align: center"></td>
            </tr>

        </tbody>
    </table>

</asp:Content>

